import request from '@/utils/request';

export function getRemoteAPI(data) {
  return new Promise(resolve => {
    console.log('data :>> ', data);
    const respones = {
      data: {
        list: new Array(20).fill({}).map(item => {
          return {
            id: 2,
            name: '陈东',
            age: '26岁',
            imgs: [
              'https://img1.baidu.com/it/u=1122737613,1740562972&fm=253&fmt=auto&app=120&f=JPEG?w=889&h=500',
              'https://img2.baidu.com/it/u=724223739,2372869883&fm=253&fmt=auto&app=120&f=JPEG?w=1280&h=800',
              'https://img2.baidu.com/it/u=4063740556,872387683&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500',
              'https://img2.baidu.com/it/u=638285213,1746517464&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800',
              'https://img1.baidu.com/it/u=3549522664,2004387788&fm=253&fmt=auto&app=120&f=JPEG?w=1422&h=800'
            ],
            phone: 15525955525,
            address: '中国 四川省 成都市 武侯区',
            date: new Date(),
            desc: '光芒越耀眼，人生越苦短。死亦轮回生，生亦无知年。'
          };
        }),
        total: 100
      },
      no: 0
    };
    setTimeout(() => {
      resolve(respones);
    }, 500);
  });
}

export function getList(data) {
  return request({
    url: '/ads/list',
    method: 'post',
    data
  });
}
